Dear All,
In a CSV file, say that a given column has been extracted. In that column, information is missing (i.e. blank lines appear). I would like to replace the blank lines by the last valid line (not blank) previously read.
For example, consider the extract below:
I would like this extract to be replaced by:
I wrote a simple script to do the job that reads myfile.txt and Would anybody have a suggestion?
Cheers, Bagvian
Moderator's Comments:
Please use CODE tags as required by forum rules!
Hello bagvian,
Could you please let us know if this is a typo or it is real, your all Output sample looks fine apart from last digit 198 which comes into a space which is before it? All other digits are filling spaces which are coming after them, so could you please confirm on this?
Also if this is not a typo then kindly do let us know what all are conditions where you need this kind of output please.
Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
I have a file which has the first blank line:
sundev22$cat /t1/bin/startallocs
/t1/bin/startallocsys 123
sundev22$
Is there a command to remove this first blank line? Thanks for help -A (4 Replies)
i have a file called Cleaner1.log . This files have some blank lines also.My requirement is that it should ignore the blank lines and give me the lines that contain some data.
I m using this logic in a script:
below the contents of file :
Maximum Time Taken for Processing(Failed) RR... (4 Replies)
I have a number of files (arranged in directories) which have last line blank,
I am trying to synchronize my code with other env and due to this blank lines, all files error out as different although only difference is that of balnk line at end of file.
Is there a way I can recursively... (2 Replies)
I want to get the blank line number of a file.
example:
9000|9000|WW|1|1|SL|472|472|LC|2272|1072|MTY|niceDay
9000|9000|WW|1|1|SL|470|470|MC|1270|1172|MPVT|nice
9000|9000|WW|1|1|SL|472|472|LC|1072|1672|MBD|Sonice
9000|9000|WW|1|1|SL|473|473|LF|1173|1173|MTY|nice666
I want to get... (5 Replies)
Hi
I nned cmd to which will help me to replace a line in file with blank line
e.g.
file1
a
b
c
d
e
after running cmd I shud get
file1
b
c
d
e (5 Replies)
Hi Guys,
I have a file in which each set of records are separated by two blank line. I want to replace it with a single blank line.
Can you guys help me out?
Regards,
Magesh (9 Replies)
hlow all i need help
how can i replace blank number with awk
input.txt
300::|355264313178490
301::|358814003239510
302::|358316038113400
303::|357954002633660
304::|354072040694090
305::|356956015214190
306::|352943020525180
307::|359574033836610
308::|381810990023580
so will be like... (4 Replies)
Need help to replace the line beginning with tcp_sendspace with a blank line.
# cat if
en0: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN>
inet 10.27.53.21 netmask 0xffffff00 broadcast 10.207.52.255
inet... (11 Replies)