![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum 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 |
| parsing xml with awk/sed | ricgamch | Shell Programming and Scripting | 3 | 05-28-2008 07:39 AM |
| Awk Parsing | bombcan | Shell Programming and Scripting | 2 | 04-24-2008 11:45 AM |
| parsing | tungaw2004 | UNIX for Dummies Questions & Answers | 15 | 03-27-2007 05:33 PM |
| XML parsing | handak9 | High Level Programming | 1 | 11-01-2004 05:13 PM |
| Text parsing question | 98_1LE | UNIX for Dummies Questions & Answers | 3 | 03-24-2002 08:04 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
|||
|
|||
|
Quote:
Code:
for file in "$(echo dat*)"
do
xlsdate=$(echo $file | awk '{split($2,a,"\.xls");print a[1]}')
fmtdate=$(echo $xlsdate | awk -F"-" '{for(i=NF;i>=1;i--) s=s""$i;print "20"s}')
echo $xlsdate
echo $fmtdate
echo $file
done
|
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
Also you probably mean "for file in dat*" rather than the silly echo. (^:
|
|
#10
|
|||
|
|||
|
Quote:
d=$(echo $xlsFile | cut -c4-5) m=$(echo $xlsFile | cut -c7-8) y=$(echo $xlsFile | cut -c10-11) and it worked okay. Thanks! |
|
#11
|
|||
|
|||
|
Quote:
Also, I was using Korn shell. Thanks! |
|
#12
|
|||
|
|||
|
Quote:
|
|
#13
|
|||
|
|||
|
hi Era,
hope you are doing well, can you answer few threads pls sendmail help required how to break mysql dump sql file I am waiting for your kind reply. Cheers, Bash |
|||
| Google The UNIX and Linux Forums |