Search Results

Search: Posts Made By: shabeena
1,680
Posted By RudiC
To overwrite the input file, redirect the output...
To overwrite the input file, redirect the output to a temp file, and then, if successful, mv temp back to the original file.
1,680
Posted By RudiC
Any attempts/ideas/thoughts from your side? ...
Any attempts/ideas/thoughts from your side?

However. try
awk '{NF = 4}1' FS="|" OFS="|" file
040|14300|40.0|563000
042|13200000|40.0|
041|100|40.0|
043|10000|40.0|
045|102|40.0|
4,561
Posted By RavinderSingh13
Hello shabeena, Could you please try...
Hello shabeena,

Could you please try following and let me know if this helps you.

awk -F"|" '{$2=strftime("%c",$2)}; 1' OFS="|" Input_file > Temp_Input_file
mv Temp_Input_file Input_file
I...
4,561
Posted By RavinderSingh13
Hello shabeena, Could you please try...
Hello shabeena,

Could you please try following and let me know if this helps.

echo "1458628242" | awk '{ printf "%s -- %s\n", strftime("%c",$1), $0 }'
Output will be as follows.

Tue 22 Mar...
1,178
Posted By RudiC
You must be kidding. This is what you posted as...
You must be kidding. This is what you posted as an...
2,436
Posted By rdrtx1
I thought the post of the input file was off. To...
I thought the post of the input file was off. To fix try:
awk '{printf $0 (($0 ~ /[]] *$/) ? "\n" : "")}' text.txt |awk '
{gsub("\"","");}
NR==1 {
l="IDN|";
for (i=2; i<=4; i++) {
...
2,436
Posted By rdrtx1
try: awk ' {gsub("\"","");} NR==1 { ...
try:
awk '
{gsub("\"","");}
NR==1 {
l="IDN|";
for (i=2; i<=4; i++) {
t=$i;
sub(":.*", "", t);
l=l t ((i==4) ? "" : "|");
}
print l > "outout1.txt";
print...
Showing results 1 to 7 of 7

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