![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find files in directory | coldstarhk | Shell Programming and Scripting | 3 | 09-29-2008 03:03 AM |
| Shell:Find a word in files in a directory and subdirectories | yeclota | Shell Programming and Scripting | 4 | 08-29-2008 06:05 AM |
| find a word in a file, and change a word beneath it ?? | vikas027 | Shell Programming and Scripting | 2 | 02-13-2008 04:23 PM |
| find files and copy into a directory | balireddy_77 | Shell Programming and Scripting | 4 | 04-27-2007 04:38 AM |
| search for certain word in a files from directory | legato | UNIX for Dummies Questions & Answers | 1 | 10-31-2006 06:35 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
print "count,pub,prodline,group,sector,date,source" > $fname
cat sp_log.summary.$firstday-$lastday.ProdlineSector | sed "s/^ *//g;s/ *$//g" >sp_log.summary.$firstday-$lastday cat sp_log.summary.$firstday-$lastday | sed "s/$/ $lastyy-$lastmm cache/;s/ /,/g" >> $fname cat $fname | sed "s/NULL//g" >$fname.new THIS is the part of a shell script which creates a .CSV file. Now for the data under pub field, i want to inset a ' in front of the data getting inserted. Can someone please help?? ![]() |
|
||||
|
Replace the last command with something like
Code:
sed -e 's/NULL//g' -e "2,\$s/,/,'/" $fname >$fname.new All the other occurrences of cat are Useless, too; sed is perfectly capable of reading from a named file all by itself. |
|
||||
|
Query
Thank you, i will check it out...
1 more query i had, in the first question, the grep method worked, Thanks But if i want to get the results page vise what is the command?? sibce it scrolls down and i am nto able to note anything Thanks All for your help!!! ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|