½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > Áú¹®°ú´äº¯ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
javascript
PHP
ASP
CSS
mysql
html
jquery
������
image
mobile
API
slide
°Ô½ÃÆÇ
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ Áú¹®°ú´äº¯ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 84 | Á¶È¸¼ö 1,817 | µî·ÏÀÏ 2003-11-04 16:08:14

´Ð³×ÀÓ

HappyCGI

À̸ÞÀÏ

webmaster@happycgi.com

Á¦¸ñ

[´äº¯] [´äº¯] [´äº¯] [´äº¯] [´äº¯] Ä«Å×°í¸®º°·Î ºÐ·ùÇϴ°Í..perl·Î
³»¿ë
[sunny97´Ô ¿øº»±Û]

°¨»çÇÕ´Ï´Ù. ¿ì¼± À¥¿¡ ±¸µ¿½ÃÅ°´Â°ÍÀº °øºÎÇغ¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.

±×·³ ÇÑ°¡Áö¸¸ ´õ ¿©Âã°Ú½À´Ï´Ù.

 

¿ì¼± Á¦ Äڵ带 Á» ºÁÁÖ¼¼¿ä

 

my %all = ();

open ( FIN, "data.txt");
while( <FIN> )
{
    chomp;
    s/^\s*"//g;
    s/"\s*$//g;
    s/\s*"\s*,\s*"\s*/","/g;
    @arr = split( /","/,$_);
        $all{ $arr[39] }{ $arr[40] }{ $arr[41] } = 1;

 }
close(fp);


foreach $k1 ( keys %all )
{
       print "$k1\n";
        $sub1 = $all{$k1};
        foreach $k2 ( keys %$sub1 )
        {
               print "===> $k2\n";
                $sub2 = $sub1->{$k2};
                foreach $k3 ( keys %$sub2 )
                {
                       print "===> ===> $k3\n";
                }
        }
}

 

°¢°¢ ¿ä¼Ò°¡ Àß ³ª¿À´Â°ÍÀº È®ÀÎÀ» Ç߰ŵç¿ä.. ±×·³. ¿©±â¼­..

¿ì¼± °¢°¢ hash¿¡ ³ÖÀº µ¥ÀÌÅ͸¦ Ä«Å×°í¸®º°·Î ±×·çÇÎ ÇÒ·Á°í Çϰŵç¿ä

¿¹¸¦µé¾î

¼­¿ï½Ã - /output/0
Ãæûµµ -/output/1
°­¿øµµ -/output/2


ÀÌ·±½ÄÀ¸·Î ¸ÅÇÎÇÒ¼ö ÀÖ°Ô Â¥·Á¸é ¾î¶²°É ÀÌ¿ëÇؼ­ ¾î¶»°Ô Â¥¾ß Çϳª¿ä?
Áú¹®ÀÌ ¸¹¾Æ Á˼ÛÇÕ´Ï´Ù. -_-

 

ÇØÇÇCGI ÀÔ´Ï´Ù.

¸ÅÇÎÀ̶ó´Â Àǹ̸¦ Àß ¸ð¸£°Ú³×¿ä. ¼­¿ï½Ã°¡ ¿Ö 0ÀÌ µÇ´ÂÁöµµ Àß ÀÌÇØ°¡ ¾È°©´Ï´Ù.

¾Æ·¡ ÄÚµå´Â txt¿¡¼­ ½ÃÀÇ Á¤º¸¸¸ ¹è¿­·Î »Ì¾Æ¿À´Â °ÍÀÔ´Ï´Ù.

Âü°íÇϽʽÿÀ.


[ÇÁ·Î±×·¥ÄÚµå]

#!/usr/bin/perl

print "content-type:text/html\n\n";

#ºó¹è¿­À» ¸¸µì´Ï´Ù.
@get_city = ();
open ( FIN, "data.txt");
while( <FIN> )
{
 $_ =~s/"//g;
 @get_info = split(/,/,$_);
 push(@get_city,$get_info[5]);
 }
close(fp);

print @get_city;




@get_city´Â Áߺ¹µÇ´Â ½ÃÀÇ °ªµµ °¡Áö°í ÀÖ½À´Ï´Ù.
¾Æ±î À̾߱⠵å·ÈÁö¸¸ Ã¥ÀÌ ¾ø¾î¼­ ã´Âµ¥·Î ¿Ã¸®µµ·Ï ÇÏ°Ú½À´Ï´Ù. ^^


txt°¡ ±×·±½ÄÀ¸·Î ÀÖ´Ù¸é ±»ÀÌ º¹ÀâÇÏ°Ô ÇÒ ÇÊ¿ä¾øÀÌ
ÀÏ´ÜÀº ½ÃÀÇ Á¤º¸¸¸ »Ì¾Æ³»°í
½Ã¸¦ ¼±ÅÃÇßÀ» °æ¿ì ½ÃÀÇ °ªÀ» °¡Áö°í ´Ù½Ã txt ¸¦ ¿­¾î¼­
½ÃÀÇ ÇϺΠ±¸±ºÀ» Ãâ·ÂÇØÁÖ¸é °£´ÜÇÒ°Í °°½À´Ï´Ù.

ÁÁÀº ÇÏ·çµÇ¼¼¿ä.

Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û Ä«Å×°í¸®º°·Î ºÐ·ùÇϴ°Í..perl·Î 2003-11-04 10:38:24
´ÙÀ½°Ô½Ã±Û splitÇϱâÀü ±Ã±ÝÇÑ°ÍÀÌ ÀÖ½À´Ï´Ù. 2003-11-05 15:40:20