10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
While looping through a file, I am cutting different length of characters (based on their length) like columns and want to produce the output in a separate file with different columns being separated by a comma.
How to achieve this with an online command. I don't want to create multiple variables... (8 Replies)
Discussion started by: mady135
8 Replies
2. Shell Programming and Scripting
Hi,
Extremely new to Perl scripting, but need a quick fix without using TEXT::CSV
I need to read in a file, pass any delimiter as an argument, and convert it to bar delimited on the output. In addition, enclose fields within double quotes in case of any embedded delimiters.
Any help would... (2 Replies)
Discussion started by: JPB1977
2 Replies
3. Shell Programming and Scripting
Hi,
I have a No Delimiter variable length text file with following schema -
Column Name Data length
Firstname 5
Lastname 5
age 3
phoneno1 10
phoneno2 10
phoneno3 10
sample data - ... (16 Replies)
Discussion started by: Gaurav Martha
16 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
I am trying to list the various dates for which the file is available in a directory using the command below, (& subsequently pass the command output to a loop)
Command :
ls dir|grep 'filename'|cut -d '_' -f1|cut -c1-8|tr '\n' ','
However, it is giving me an extra comma... (6 Replies)
Discussion started by: dsfreddie
6 Replies
5. UNIX for Dummies Questions & Answers
I can not make it work, it prints \t rather than introduce tabs.
cut -d "," -f 4,8 Samples.csv --output-delimiter="\t" | sort > out
Since I am running this command within a shell script, I tried manually inserting tab in this command, still does not work. I am using bash shell
Suggestions... (8 Replies)
Discussion started by: analyst
8 Replies
6. Shell Programming and Scripting
Hello,
I am trying to find the record count in a specific folder,
Here is the part of the code
===========================
STARTDATE=`date +"%y%m%d%H%M"`
for i in `ls *.DAT`
do
wc -l $i >> /XYZ/SrcFiles/"Record_counts"$STARTDATE.csv
... (2 Replies)
Discussion started by: Shanks
2 Replies
7. Shell Programming and Scripting
Dear All,
1.txt (tab in between each value in a line)
a b c
a b c
a c d
you can see below, why with ~ i can output with tab, but = cannot?
# awk -F'\t' '$2 ~ /b/' 1
a b c
a b c
# awk -F'\t' '$2 = "b"' 1
a b c
a b c
a b d
... (1 Reply)
Discussion started by: jimmy_y
1 Replies
8. Shell Programming and Scripting
Hi,
I have a string like ABC.123.XYZ-A1-B2-P1-C4. I want to delimit the string based on "-" and then get result as only two strings. One with string till last hyphen and other with value after last hyphen... For this case, it would be something like first string as "ABC.123.XYZ-A1-B2-P1" and... (6 Replies)
Discussion started by: gupt_ash
6 Replies
9. UNIX for Dummies Questions & Answers
I have a file which I am processing using awk to spit out the following:
export CLIENT=1 ; export USER=1 ; export METABASE=1 ; export TASK=1 ; export TOTAL=3
What i want to do now is execute that within the script so those variables are available to other commands. I've tried piping the... (3 Replies)
Discussion started by: Cranie
3 Replies
10. Shell Programming and Scripting
How can i set a variable field delimiter using awk??
I wanna do something like this ,but i canīt get the correct syntaxis :
VARI=TEST
echo "0121212TESTxvcshaashd"|awk 'FS="$VARI" {print $2}'
Thanks. (2 Replies)
Discussion started by: Klashxx
2 Replies