The data is supposed to be arranged in a group of 10 values. Some groups do not have all 10 values.
So for example the following numbers belong to one group:
The following set of numbers belongs to another group but does not have all 10 values:
I would like to stuff this group with blank lines.
So my final output file should look like this:
So group 1 had all 10 values, group 2 (numbers 1,33,32,13) had only 4 values hence, padding of 6 more newlines to make it 10; group 3 (13,23,44,11,67,87) has only 6 values so padd it with 4 newlines to make it 10, etc.
Next I want to collect all these values in an array including the empty lines as a null array element.
These numbers are extracted from another file which has groups of 10. All I want is to pad the file which has missing entries, with newlines. Will it be easier if I modify the original file as follows:
So now I have inserted a newline between individual groups.Group1 has all 10 entries, group 2 has only 4 entries (that means I will have to add 6 newlines), group 3 has 6 entries (so I will have to add 4 lines) and so on.
Hi Friends,
I have a data file with new lines.
How to remove the newlines and should be showed in one line.
I tried using the command
tr -d '\n' filename
sed 's/\n//g' file name
Ex: 1 abc hyd is actual record
but in our scenario showing it as
1 abc
hydthis record should be like... (5 Replies)
Hi All -
I am in need of some help in formating the below file
Requirement -
1) replace newlines with space
2) replace '#~# ' with newline
-----------------------
sample inputfile a
I|abc|abc|aaa#~#
I|sddddd|tya|dfg
sfd
ssss#~#
I|tya1|tya2|dfg|sfd|aaa#~#... (5 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)
Hello. I'm making a (hopefully) simple shell script xml parser that outputs a file I can grep for information. I am writing it because I have yet to find a command line utility that can do this. If you know of one, please just stop now and tell me about it. Even better would be one I can input... (10 Replies)
What's the best way to find a string in a very long file without newlines in Unix? The standard utility I'm aware of for finding a string in a single file is grep, but for a long file without newlines, I think the output is just going to be the input. I suppose I could use sed to replace the... (5 Replies)
Hi,
I have a fixed length text file that needs to be cut into individual files in aix and facing padding issues. If I have multiple blank spaces in the file it is just making it one while cutting the files..
Eg:-
$ - blank space
filename:file.txt
... (2 Replies)
Hi champs!
I have a fixed width file in which the records appear like this
11111 <fixed spaces such as 6> description for 11111 <fixed spaces such as 6> some more field to the record of 11111
22222 <fixed spaces such as 6> description for 22222 <fixed spaces such as 6> some more field to the... (8 Replies)
Hello, I'm having a problem figuring out the syntax for padding 10-99. Everything else in the program works fine so I want to focus in on just this part of the code. Below is a snippet of the code that I am having problems with. I appreciate all the help I can get. Thank you.
The script... (7 Replies)
Hi All,
I am getting a xml file where the first field contains a carriage return and the all other fields doesnot contains any carriage return. So all the other records comes in the second line.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:iSeriesCspIntegration... (3 Replies)
Hi Gurus,
There is a ASCII file in which a comma is used as a seperator for the amount field when the amount exceed seven digits: e.g. 0001300,000. Now, this comma needs to be removed from this field, after padding leading zeros (to maintain the ASCII positions) e.g. 00001300000.... (1 Reply)