Search Results

Search: Posts Made By: bhupinder08
2,799
Posted By bhupinder08
Thanks for your reply. But the code...
Thanks for your reply.

But the code suggested does grep for SQL commands if spanned across multiple lines.
2,799
Posted By bhupinder08
Read paragraph from file
Hi,

I have a file containing SQL commands in following format. I need to run the SQLs separately and also print the status of SQL, successful/unsuccessful.

File : SQL.dat
## SQL1
select *...
2,617
Posted By bhupinder08
Will it be able to remove tabs as well?
Will it be able to remove tabs as well?
2,617
Posted By bhupinder08
sed 's/'"$spc"'*$//' a.txt Worked for me .....
sed 's/'"$spc"'*$//' a.txt

Worked for me .. Thanks !!

---------- Post updated at 08:41 AM ---------- Previous update was at 08:40 AM ----------

Thanks RudiC/MadeInGermany for your time :-)
2,617
Posted By bhupinder08
I am using KSH on AIX 6.1
I am using KSH on AIX 6.1
2,617
Posted By bhupinder08
Still the same issue. $ sed "s/[...
Still the same issue.

$ sed "s/[ "$'\t'"]$//" a.txt
upg_prod_tes
upg_prod_new

$ sed "s/[ "$'\t'"]*$//" a.txt
upg_prod_tes
upg_prod_new


Not sure if I would be able to make use the...
2,617
Posted By bhupinder08
sed removing extra character from end
Hi,

Searching through forum I found "sed 's/[ \t]*$//'" can be used to remove trailing whitespaces and tabs from file. The command works fine but I see minor issue as below. Can you please suggest...
4,464
Posted By bhupinder08
Is it possible to have the entire command in...
Is it possible to have the entire command in single line?

Thanks for your time.
4,464
Posted By bhupinder08
Add new line at beginning and end of a file
Hi,

I have a specific requirement to add text at the beginning and end of a plain text file. I tried to use "sed" with '1i' and '$a' flags but these required two separate "sed" commands separated...
1,921
Posted By bhupinder08
Seems bit difficult as the () braces are used at...
Seems bit difficult as the () braces are used at multiple places in CSV and the file has ~0.1M lines to upload.

Is there any way I can replace "('*')" with null string since numeric data does not...
1,921
Posted By bhupinder08
The "[()]" is replacing all braces in CSV. The...
The "[()]" is replacing all braces in CSV. The negative values are mentioned within () and it must be retained.

echo "(1), ('2013-08-12 18:34:17.0')" | sed 's/[()]//g; s/....-..-.....
1,921
Posted By bhupinder08
Thanks Akshay for replying. Can you please...
Thanks Akshay for replying.

Can you please suggest how can I include the "(" and ")" brackets inside this replacement string as some of the lines in CSV have date value inside braces.

Eg....
1,921
Posted By bhupinder08
Replace a string pattern
Hi,

I have a CSV with following type of data and would like to replace the timestamp information with 'null' string. Can you please suggest me on same?

8,1,'1','1',11,'2013-08-12...
2,043
Posted By bhupinder08
Thanks everyone for your helping hand.
Thanks everyone for your helping hand.
2,043
Posted By bhupinder08
Thanks all for your reply. The AWK solution...
Thanks all for your reply.

The AWK solution seems to be suiting better for my requirement.
"awk '/START/{p=1;sect=""}p{sect=sect?sect RS $0:$0}/END/{p=0}END{print sect}' file"

Here is it...
2,043
Posted By bhupinder08
Read few last lines of a file
Hi,

I have a txt file in below format -

START
1
2
3
4
END
START
5
6
7
8
END
START
9
10
END
1,150
Posted By bhupinder08
Need Suggestion
Hi,

I have the requirement to run multiple SQLs against database running on a server and save the output of SQL executed to a log.

I thought about writing a Function in sh that will take file...
4,943
Posted By bhupinder08
Thanks for your reply. Will egrep cut the...
Thanks for your reply.

Will egrep cut the lines from file_a?
4,943
Posted By bhupinder08
Cut Lines using grep
Hi,

I have a SQL script with "create table" and "alter table" statements and I want to cut all the alter table statements from original file (A) and move it to a different file (B).

Can you...
1,523
Posted By bhupinder08
Redirect output from SQL to unix variable
Hi,

I have a requirement to store oracle sqlplus output to some unix variable, count the records and then print the output on the screen.

Can you please point me to any sample program for...
4,689
Posted By bhupinder08
Thank you everyone for responding to my question....
Thank you everyone for responding to my question. Specially to "ctsgnb" as the solution he provided worked perfectly in my scenario.

Thanks again :-)
4,689
Posted By bhupinder08
Modify text file using shell script
Hi,

I have a text file which is following format -

COL VAL
ABC 1
ABC 2
ABC 3
ABC 4
ABC 5

My requirement is to search for a particular value (provided by user) in the file and comment...
Showing results 1 to 22 of 22

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