I would like to change certain columns in a file depending on the users choice of input and which columns they would like to change.
Here is my csv file:
If for example they would like to change the first record, third field, or add a fourth field, how can this be done? If they add a fourth field, they have to be allowed to enter values for the fourth field for all records.
This is what I have which inly allows them to change the third field by entering the cellid for the second field.
so " id " represents all the cellid's and "paramval" represents the values
I dont know how to manipulate this csv file.
Thank you for your help.
---------- Post updated at 08:22 AM ---------- Previous update was at 08:17 AM ----------
Can I simplify this please, suppose I want to only alter the first record, third field only if the user enters a value for paramname, and if they don't, this will remain as is. Remember, it means that no cellid will be entered in this instance.
Okay well basically, it's just scripts thats I'm creating to automate some testing.
So there are scripts in one directory and csv files in another.
Here the help function tells the user their options:
so the user types ./script -h and is told how the script should be called .. that is
The script looks for the csv file from the specified directory and converts it to a dsxfile and stores it another directory. The user does not have to specify directory paths.
This part works fine.
Now I need the script to output the help function when nothing is entered when calling the script. It does so if any other character is entered except the ones specified in getopts ( c , d , h ):
How do I get it to display help in this case:
Thank you
---------- Post updated at 09:32 AM ---------- Previous update was at 09:29 AM ----------
Oooops, this is for my previous thread ... it still doesn't work .....
To do add, change and delete to a csv file using a shell script is asking a lot. Why not use MS Excel and save the spreadsheet as a csv file on the unix system
Please help me to get required output for both scenario 1 and scenario 2 and need separate code for both scenario 1 and scenario 2
Scenario 1
i need to do below changes only when column1 is CR and column3 has duplicates rows/values. This inputfile can contain 100 of this duplicated rows of... (1 Reply)
I want to bring values in the second column into single line for uniq value in the first column.
My input
jvm01, Web 2.0 Feature Pack Library
jvm01, IBM WebSphere JAX-RS
jvm01, Custom01 Shared Library
jvm02, Web 2.0 Feature Pack Library
jvm02, IBM WebSphere JAX-RS
jvm03, Web 2.0 Feature... (10 Replies)
Hi All,
I have a requirement where I need to find sum of values from column D through O present in a CSV file and check whether the sum of each Individual column matches with the value present for that corresponding column present in the trailer record.
For example, let's assume for column D... (9 Replies)
Hi,
I have a table to be imported for R as matrix or data.frame but I first need to edit it because I've got several lines with the same identifier (1st column), so I want to sum the each column (2nd -nth) of each identifier (1st column)
The input is for example, after sorted:
K00001 1 1 4 3... (8 Replies)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Hello All,
I have a below data in a .csv file where all rows where col1 is A, col2 is odd numbers, similarly even numbers for all rows where col1 is B.
Note that my data has some other columns(not shown here) too (around 100) after col2.
Tool,Data
A,1
A,3
A,5
....
so on
B,2
B,4
.... ... (4 Replies)
Hi Gurus,
I have a tab separated text file with two columns. I would like to make the first column values as headings for the second column values.
Ex.
>value1 subjects
>value2 priorities
>value3 requirements
...etc
and I want to have a file
>value1
subjects
>value2
priorities... (4 Replies)
I have results from some statistical analyses.
The format of the results are as given below:
I want to select lines that have a p-value (last column) less than 0.05 from all the results files (*.results) and cat to a new results file.
It would be very nice if a new column is added that tells... (2 Replies)
Hi All,
I have a file which is having 3 columns as (string string integer)
a b 1
x y 2
p k 5
y y 4
.....
.....
Question:
I want get the unique value of column 2 in a sorted way(on column 2) and the sum of the 3rd column of the corresponding rows. e.g the above file should return the... (6 Replies)
Dear Guyz:)
I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z).
I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)