If you don't mind having the extra space appear at the end of the list instead of at the start of the list, you can get rid of the call to awk by using:
If the resulting output is more than bytes long, the value returned by the command:
on your system, awk won't work portably. (It may work on some systems, but report a "Line too long" or "Buffer overflow" error, or silently truncate the output on others.)
But more importantly, why do you want to do this at all?
I have a script that is run each night by cron. This script generates an extract then places it into an 'extracts' folder and also ftp's a copy to another server.
I have set up the script to remove any files in the extracts folder greater than 28 days old (this occurs each time the script is... (1 Reply)
Context:
I need to remove unwanted newlines from a data file listing books and associated data. Here is a sample listing ( line numbers included ):
1 360762| Skip-beat! 14 /| 9781421517544| nb | 2008.| Nakamura, Yoshiki.| NAKAMUR | Kyoko Mogami followed
2 her true love Sho to Tokyo to... (6 Replies)
Hello, there. I have a file that's a horrible, horrible mess. (Basically, it's an export from a firewall config.) The people who generated the file didn't think that putting a newline in the middle of a hostname would ever be a problem. It is.
Here's an example of the stuff in the file:
... (2 Replies)
Hi. We have some data that's generated from a webpage. Part is pretty well-formatted, but part of it preserves newlines in a way that breaks the record separating in awk. Here's 2 records, filtered through cat -e:
Jones,Bob,20,Q: What is your favorite ice cream?$
A: Butter Pecan$
Q: Do you... (6 Replies)
Hi all,
i am getting count from oracle 11g by spooling it to a file.
Now there are some newline characters and blank spaces i need to remove these.
pl provide me a awk/sed solution.
the spooled file is attached.
i tried this.. but not getting req o/p (6 Replies)
I am trying to get multiple strings removed or replaced with space in a file, for individual strings I have been using the following and it works
sed -e 's/#*#*//g' test_1.dat > test_2.dat
what needs to be done if multiple strings are to be removed?
For example I will need to remove the... (3 Replies)
Hi buddy's
my file are like this:
s.no,name,band,sal
1,"suneel",,10
2,"bargav
sand",,20
30,"
ebdug gil",,4
but i want
s.no,name,band,sal
1,"suneel",,10
2,"bargav sand",,20
30,"ebdug gil",,4
any command or Shell script for this.
please help me it's urgent to implement (33 Replies)
I need to remove new lines and carriage returns from csv file.
Is there anything other than sed and gwak by which we could achieve this ? Any suggestions ? (3 Replies)
The bash below executes and does find all the .bam files in each R_2019 folder. However set -x shows that the .bam extension only gets removed from one .bam file in each folder (appears to be the last in each). Why is it not removing the extension from each (this is $SAMPLE)? Thank you :).
set... (4 Replies)