10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
Is there a sed/awk cmd that will remove blank space from between words in a particular field, replacing with a single space?
Field containing 'E's in the example below:
Example input file:
AAAAA AA|BBBB|CCCCCCC|DDDDDD |EEEE EEEEEE| FFF FFFFF|
... (6 Replies)
Discussion started by: dendright
6 Replies
2. UNIX for Dummies Questions & Answers
I have simple test.sh script, see below:
bill_code=`echo $record | awk -F"|" '{print $1}'`
Fullname=`echo $record | awk -F"|" '{print $3}'`
email=`echo $record | awk -F\ '{print $4}'`
The last field contains spaces: see csv below:
A0222|Y|DELACRUZ|-cc dell@yahoo.com-cc support@yahoo.com
... (9 Replies)
Discussion started by: quay
9 Replies
3. Shell Programming and Scripting
Hi
I'm trying to loop through an array that contains other arrays and these arrays consist of strings with spaces. The problem is that I can't seem to preserve the spacing in the string. The string with spaces are either divided into multiple items if I change IFS to \n or all the elements of... (4 Replies)
Discussion started by: kidmanos
4 Replies
4. UNIX for Dummies Questions & Answers
Consider my input string as "abc|b f g|bj gy"
I am expecting the output as "abc|bfg|bj gy".
Please let me know how to achieve this in unix?
Thanks (8 Replies)
Discussion started by: pandeesh
8 Replies
5. Shell Programming and Scripting
Hi everyone..
I'm trying to eliminate multiple whitespaces from a file..
I must make use of shell script to eliminate whitespaces..
Take a look at the sample file
1 int main()
2 {
3 int a,b;
4 printf("Enter the values of a and b");
5 scanf("%d%d",&a,&b);
6 if(a>b) ... (6 Replies)
Discussion started by: abk07
6 Replies
6. Shell Programming and Scripting
Hi Everyone,
#!/usr/bin/perl
use strict;
use warnings;
my @test=("a;b;qqq;c;d","a;b;ggg;c;d","a;b;qqq;c;d");
would like to split the @test array into two array:
@test1=(("a;b;qqq;c;d","a;b;qqq;c;d"); and @test2=("a;b;ggg;c;d");
means search for 3rd filed.
Thanks
find the... (0 Replies)
Discussion started by: jimmy_y
0 Replies
7. Solaris
what my code is doing, it is executing a sql file and the resullset of the query is getting stored in the text file in a fixed format. for that fixed format i have used the following code::
Code:
awk -F":"... (2 Replies)
Discussion started by: priyanka3006
2 Replies
8. Shell Programming and Scripting
Hi all,
I've a .csv file containing data per line delimited with '|' (The fields may contains elements with spaces).
e.g. (really a sample)
ID|Name|fon
12345|Celal Dikici|+4921123456
12346|Celal Dikici Jun.|+4921123456
12347|Celal Dikici Sen.|+4921123456
12348|Celal|+4921123456... (3 Replies)
Discussion started by: Celald
3 Replies
9. UNIX for Dummies Questions & Answers
Hi all!
i need your help.
I'm getting started with this...
in need to insert in an array string values. But the thing is that this strings have blank spaces...
for example if a want to put "filed1 = " and "field2 = " .... in the array , when i want to print all the fields, it only shows... (4 Replies)
Discussion started by: kamicasse
4 Replies
10. Shell Programming and Scripting
I have been working on some code for a while, that will parse a log file, look for a specified time discrepancy between entries, and then print that line +/- n other lines out to a file...
#!/bin/bash
file=$1 # The input log file
maxTime=$2 # The time discrepancy to look for
n=$3 ... (1 Reply)
Discussion started by: jjinno
1 Replies