![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help to process each line in a file... | shyjuezy | UNIX for Dummies Questions & Answers | 7 | 05-14-2008 04:20 AM |
| Need to serach if a new line character exists on the last line in a file | sunilbm78 | UNIX for Dummies Questions & Answers | 10 | 02-29-2008 10:15 AM |
| Multiple file processing - 1st line only to process - search/match substring | toneatlondon | Shell Programming and Scripting | 2 | 01-02-2008 05:20 PM |
| Appending the line number and a seperator to each line of a file ? | pjcwhite | Shell Programming and Scripting | 4 | 03-20-2007 09:29 PM |
| Remove header(first line) and trailer(last line) in ANY given file | madhunk | Shell Programming and Scripting | 2 | 03-13-2006 11:36 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Process file line by line
Hi
I have a csv file as follows 608, Barnwood PFS,,2 150, Barnwood CS,2,4 etc When i do for lines in `cat file.dat` the space in second argument seems to screwing the lines up. Any suggestions to get around this? Thanks |
| Forum Sponsor | ||
|
|
|
|||
|
Hi ,
i encountered the following problem doing that : while read line do serveur1=`echo $line|awk 'BEGIN {FS="\/"} {print $1}'` serveur2=`echo $line|awk 'BEGIN {FS="\/"} {print $1}'|sed -e s/A/B/g` chemin1=`echo $line|awk 'BEGIN {FS="\ "} {print "/base/base01/"$2}'` chemin2=`echo $line|awk 'BEGIN {FS="\ "} {print "/base/base01/"$2}'|sed -e s/base01/base02/g` rsh $serveur1 -l notes01 "mv $chemin1 $chemin1.leon" done < $fic_tmp1 the while treatment doesn't treat correctly the input file and exit after the first line. It seems that the differents variables in the rsh command don't return correctly the hand to the while treatment ! How to correct that ? Thanks in advance Christian |