Search Results

Search: Posts Made By: dashing201
1,403
Posted By RudiC
Try also sed...
Try also
sed 's/<?=test.getObjectName("[^"]*",//; s/, *"D") *?>//; s/[" ]//g; s/\([^,]*\),\([^,]*\)/\2.\1/ ' file
testTBL
testDB.testTBL
910
Posted By apmcd47
sed 's/--[^\r]*\r//g' file Andrew
sed 's/--[^\r]*\r//g' file

Andrew
2,378
Posted By Akshay Hegde
Try this $ awk ...
Try this

$ awk '{for(i=2;i<=NF;i++){split($i,A,"-");for(j=A[1];j<=c=(A[2]>A[1])?A[2]:A[1];j++)printf $1"~"j OFS}printf RS}' file HELLO~100 HELLO~101 HELLO~102 HELLO~103 HELLO~104 HELLO~105...
2,378
Posted By Akshay Hegde
Please use code tag Try $ cat file ...
Please use code tag

Try

$ cat file
100-105
107
108-112

$ awk -F'[-]' '{for(i=$1;i<=c=(NF==1)?$1:$2;i++) printf i OFS ;printf RS}' file

100 101 102 103 104 105
107
108 109 110 111...
2,602
Posted By in2nix4life
Providing you have the GNU version of the date...
Providing you have the GNU version of the date command available this should work.


#!/bin/bash
#
#

# check the command line
if [ $# -ne 1 ]
then
echo "Usage: ${0##*/} <year and day...
2,425
Posted By krishmaths
awk -F"HELLO_" '{print $2}' filename | awk...
awk -F"HELLO_" '{print $2}' filename | awk -F"_BYE" '{print $1}'
2,363
Posted By bartus11
Try: perl -F";" -ane 'print if...
Try: perl -F";" -ane 'print if $F[1]=~/HELLO_UNIX_[^_]+$/' file
13,176
Posted By ctsgnb
another one awk '/Hello/{getline...
another one

awk '/Hello/{getline x;sub("Name","IDENTITY",x);print $0 RS x;next}1' infileawk '/Hello/{print;getline;sub("Name","IDENTITY");print;next}1' infileThat last one also works if the first...
7,723
Posted By Franklin52
Assuming your file has real double quotes instead...
Assuming your file has real double quotes instead of the so-called smart quotes:
awk -F "\"" ' {
for(i=1;i<=NF;i+=2) {
gsub(";", "|", $i)
}
}1' OFS="\"" file
7,472
Posted By
ls [0-9]*abc[0-9]* or ls *abc* | grep...
ls [0-9]*abc[0-9]*

or

ls *abc* | grep -v "*.gz"
6,187
Posted By citaylor
They are generally interchangable, however the...
They are generally interchangable, however the curly braces disambiguate the variable, so for example:

var="to the "
echo "Hello$varworld"
echo "Hello${var}world"

Would return two different...
6,187
Posted By bartus11
${var} is usefull when you want to include the...
${var} is usefull when you want to include the variable in some echo output (in shell, in perl it can be print), that needs to be followed immediately by some string. Here is an example:
This wont...
6,187
Posted By Scrutinizer
In principle they are the same, but one should...
In principle they are the same, but one should use ${var} if $var is immediately followed by an alphanumerical character or an underscore (_) . The curly brackets are also necessary if you want to...
Showing results 1 to 13 of 13

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