Search Results

Search: Posts Made By: RichZR
2,118
Posted By RichZR
Hi Adam, Watching this post carefully as I...
Hi Adam,

Watching this post carefully as I have a similar requirement. Hopefully someone will be able to assist you! :)
2,057
Posted By RichZR
Hi we have utilised: awk 'NR==1{print; next}...
Hi we have utilised:
awk 'NR==1{print; next} {n=split($2,F,/,/); for(i=1; i<=n; i++) {$=F[i]; print}}' FS=\| OFS=\| <filename>

and face a new challenge. Example of source data:


Output...
2,057
Posted By RichZR
That works a treat! :b::D
That works a treat! :b::D
2,057
Posted By RichZR
Pivot Rows to Columns, with field separator
Hi All,

I have a requirement to flatten data out, based on the value in COL_2. Our file is pipe delimited, however COL_2 contains a comma separated string, which we would like to pivot out from...
7,450
Posted By RichZR
Hi Ravinder, Apologies - That was a typo...
Hi Ravinder,

Apologies - That was a typo from my side. I have amended this now in my original post. Also amended the Quote section to a Code Section.

---------- Post updated at 02:03 PM...
7,450
Posted By RichZR
Linux - Join 2 csv files with common key
Hi,

I am trying to join 2 csv files, to create a 3rd output file with the joined data.

Below is an example of my Input Data:

Input File 1

NAME, FAV_FOOD, FAV_DRINK, ID, GENDER
Bob, Fish,...
1,195
Posted By RichZR
Thanks Rudi - This worked a treat! :D:b:
Thanks Rudi - This worked a treat! :D:b:
3,116
Posted By RichZR
Hi Rudi, Thanks for the above. ...
Hi Rudi,

Thanks for the above.

Unfortunately I am not able to get your command to work. Below is my data file:

ABC|00000001|15-Dec-15|13400
ABC|00000001|31-Jan-16|13490...
1,195
Posted By RichZR
Linux - Calculations between multiple rows of data
Morning All,

I am needing assistance with a calculation process, which performs calculations on a group of records.

Here is a breakdown of my requirement:

Col1 = Always same value.
Col2 =...
3,116
Posted By RichZR
Hi Rudi, Thanks for the above. I...
Hi Rudi,

Thanks for the above.

I have given this a try, and it is nearly there.

One thing I have noticed is that for the first record, it is not processing the first line correctly...
3,116
Posted By RichZR
Hi Rudi, My input data will be structured...
Hi Rudi,

My input data will be structured as follows:

Col1 Col2 Col3 Col4
ABC 00000001 15-Dec-15 13000
ABC 00000001 31-Jan-16 13500
ABC 00000001 29-Feb-16 13700
ABC 00000001...
4,111
Posted By RichZR
awk - Print where value is in quotes
Hi All,

I have input data like follows:

"1234"|"ABC"
"1234"|"CBA"
"1222"|"ZZZ"

I am trying to awk print all records where Col1 = "1234".

Below is the code I have so far:

Var1=1...
3,116
Posted By RichZR
Linux - Pivot Rows to Columns
Morning All,

I am wanting to try and Pivot a set of data which is currently in a row format, to a column format. This will potentially need to run over a large dataset, therefore I am thinking awk...
15,232
Posted By RichZR
Just had a little play around with what you...
Just had a little play around with what you suggested, and found that the following works:

awk -F ',' '$4~/"2"/' <filename.csv>

The above returns only the record i require, and does not...
15,232
Posted By RichZR
Grep Specific String In CSV
Hi All,

I have a csv file like the following:

"ABCD2","EFGH2","XXXX","1"
"ABCD2","EFGH2","XXXX","2"

I want to grep out the row which contains the value of 2 within the 4th column, so then...
2,972
Posted By RichZR
Insert Inverted Commas Around Numeric Values
Hi,

I am trying to insert Inverted Commas around all the numeric values within a comma seperated string / variable.

1111,2222,3333,4444


I would like it to be:
...
4,450
Posted By RichZR
Thats worked the treat! :D :D :D Thanks...
Thats worked the treat! :D :D :D

Thanks alot!
4,450
Posted By RichZR
Thanks for the reply, much appreciated, but i am...
Thanks for the reply, much appreciated, but i am trying to stay away from perl and use AWK or SED if possible.

Cheers
4,450
Posted By RichZR
Nealry there :D The above gives the result:...
Nealry there :D

The above gives the result:

db2 select X from Y where Z IN (''AAAA''BBBB''CCC''DDD'')

How would i get the code to give the results in the format:

db2 select X from Y...
4,450
Posted By RichZR
Thanks for the reply. Will the above cater...
Thanks for the reply.

Will the above cater for an infinate amount of values that could be stored in the parameter?

Cheers
4,450
Posted By RichZR
Concatenate Loop Results
Hi,

I have the following situation:

Param1Values = AAAA,BBBB

Param1=$(echo $Param1Values| tr "," "\n")
for x in $Param1
do
db2 select X from Y where Z IN ('$x')
done

Obviously...
Showing results 1 to 21 of 21

 
All times are GMT -4. The time now is 07:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy