Works just as i'd like it to. I amended one part so that I can define which columns it should translate as my csv may have additional ones before and after the bit rate data. Please let me know if there's a more efficient way of doing this.
Thanks again everyone.
---------- Post updated at 10:34 AM ---------- Previous update was at 09:48 AM ----------
One more thing...
What if the bit rate data is not in sequential columns? How can I amend the script so that I tell it which columns to translate? For example:
Note that the position of the bit rate columns doesn't always follow a pattern such as in the following example:
I understand that I'll have to modify the script before use but it will at least be flexible.
Works just as i'd like it to. I amended one part so that I can define which columns it should translate as my csv may have additional ones before and after the bit rate data. Please let me know if there's a more efficient way of doing this.
Thanks again everyone.
Obviously, the way I set up your output heading is incorrect since the sample input you gave us didn't match your input.
Assuming that instead of fields 2, 3, and 4 containing slash separated values that you want to convert, you now have fields 5, 6, 7, 8, 9, and 10 containing slash separated values you want to convert and that each of these fields contains a single slash character, then the 2nd for loop needs to be:
instead of:
since you're adding 6 new fields to the line in the first loop. If some of these fields don't have slashes or some of these fields contain more than one slash, you need to add the number of slashes in fields 5 through 10 to 10 for the end point for the loop. If there are a variable number of slashes in fields 5 through 10, additional logic is needed to determine the end point.
If you could set up your input so the fields that need to be modified are all at the end of the line, going back to using NF as the end point will be easier.
This would have been easier on all of us if you had given us a representative sample of what you wanted done originally instead of changing requirements every time we give you something that does what you requested!
I have below Data ***************************************************
********************BEGINNING-1********************
directive url is : https://coursera-eu.mokar.com/directives/96df29ff-176a-35f7-8b1b-4ce483d15762
Src urls are :... (8 Replies)
Hy!
I need to post-process some data files which have variable (and periodic) number of fields. For example, I need to square (data -> data*data) the folowing data file: -5.34281E-28 -3.69822E-29 8.19128E-29 9.55444E-29 8.16494E-29 6.23125E-29
4.42106E-29 2.94592E-29 1.84841E-29 ... (5 Replies)
Hello,
I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this :
This is the output of ls command : I stored the output in a file filelist
1.1M... (5 Replies)
Dear fellow members,
I've just joined the forum and am a newbie to shell scripting and programming. I'm stuck on the following problem.
I'm working with large scale genomic data and need to do some analyses on it. Essentially it is text processing problem, so please don't mind the scientific... (0 Replies)
Hello guys!
I have some issue in how to processing some data.
I have some files with 3 columns. The 1st column is a name of my sample. The 2nd column is a numerical sequence (very big sequence) starting from "1". And the 3rd column is a feature of each line, represented for a number (completely... (2 Replies)
Hi!
I have 2 files containing data that I need to process at the same time, I have problems in reading a different number of lines from the different files.
Here is an explanation of what I need to do (possibly with an awk script).
File "samples.txt" contains data in the format:
time_instant... (6 Replies)
I have a file, first 5 columns are very normal, like "1107",106027,71400,"Y","BIOLOGY",,
however, the 6th columns, the user can put comments, anything, just any characters, like new line, double quote, single quote, whatever from the keyboard, like"Please load my previous SOM597G course content in... (3 Replies)
I have some process . How should i know that the process is still processing data or got hanged even though it is showing that it is running in background
I know of a command called truss. how should i use this command and determine
1) process is still processing data
2) process got hanged... (7 Replies)
I need to read contents of directory and create a list of data files that match a certain pattern and process by renaming it and calling a existing .ksh script then archiving off to file another directory. Any suggestions or samples u could point me to on using .ksh perl or other to process... (5 Replies)
hi
i am having a file of following kind:
20015#67143645#143123#4214
62014#67143148#67143159#456
15432#67143568#00143862#4632
54112#67143752#0067143657#143
54623#67143357#167215#34531
65446#67143785#143598#7456
75642#67143546#156146#845
24464#67143465#172532#6544... (5 Replies)