Search Results

Search: Posts Made By: Tapiocapioca
1,211
Posted By RudiC
How can the number of aliases be determined? Why...
How can the number of aliases be determined? Why zero aliases for test.png?

Please show some of your "disasters" for discussion.
1,211
Posted By RudiC
Not sure I understand, but does this help: ...
Not sure I understand, but does this help:
FN="randomname.png"
for i in {1..10}; do P=$(( RANDOM * (${#FN} - 4) / 32768 )); T=${FN:P:1} ; echo ${FN:0:P}${T^}${FN:P+1}; done
raNdomname.png...
1,211
Posted By RudiC
OK, let's try our luck. How about awk...
OK, let's try our luck. How about
awk -vSRC="/pictures/" -vTGT="/pictures/alias/" -vDQ='"' 'gsub (/<0(1|2)>/, _) {ORG = $0; next} {print "cp " DQ SRC ORG DQ, DQ TGT $0 DQ}' file4
cp...
2,218
Posted By RudiC
For an adaption of the awk solution, try awk...
For an adaption of the awk solution, try
awk -F\" '/="/ && /\.png/ {gsub("[? +]+", "_", $2)} 1' OFS=\" file

You seemed to want a sed solution:
sed '/\.png/ {h; s#^.*//##; s#[ +?]\+#_#g; x;...
2,218
Posted By rdrtx1
fantastico!
fantastico!
2,218
Posted By rdrtx1
awk -F\" '/="/ {gsub("[? +]+", "_", $2)} 1'...
awk -F\" '/="/ {gsub("[? +]+", "_", $2)} 1' OFS=\" xml
2,218
Posted By rdrtx1
see update.
see update.
8,613
Posted By vgersh99
I don't quite follow/understand what you're...
I don't quite follow/understand what you're trying to do and this is way too verbose, but...

awk "/$line/,/<!--begin_channel-->/" $1 | grep -v "$line" | grep -v '^<' > xxx
8,613
Posted By Don Cragun
No. No. No. No way! The command that you say...
No. No. No. No way! The command that you say is not executed correctly on CYGWYN cannot possibly work on any Linux or CYGWIN system.

As long as there are no slash (/) characters in the file...
8,613
Posted By RudiC
Your cygwin's bash and awk versions probably...
Your cygwin's bash and awk versions probably differ from Ubuntu's. The exact output including error messages would seriously help us help you!
8,613
Posted By vgersh99
would something like this be helpful? awk -f...
would something like this be helpful?
awk -f tapi..awk channels.xml where tapi.awk is:

BEGIN {
srcD="/cygdrive/c/ProgramData/data/picons"
...
1,458
Posted By RudiC
How about awk ' {print " <channel...
How about
awk '
{print " <channel id=\"" $0 "\">"
print " <display-name lang=\"it\">" $0 "</display-name>"
gsub (/ /, "_")
print " <icon...
1,458
Posted By Chubler_XL
Another solution using bash shell: ...
Another solution using bash shell:

#!/bin/bash

while read chan
do
printf "<channel id=\"%s\">\n" "$chan"

printf " <display-name lang="it">%s</display-name>\n" "$chan"
...
7,079
Posted By RudiC
It is not much clearer to me WHAT you really need...
It is not much clearer to me WHAT you really need in the end, but Don Cragun's analysis proves right when seeing your second sample input file.
You might want to safeguard your script by adding some...
7,079
Posted By vgersh99
YMMV: awk -F'"' '{$(NF-3)=$(NF-1)}1' OFS='"'...
YMMV:

awk -F'"' '{$(NF-3)=$(NF-1)}1' OFS='"' myFile
7,079
Posted By Don Cragun
Assuming that you get the above diagnostic when...
Assuming that you get the above diagnostic when running the script vgersh99 suggested:
awk -F'"' '{$(NF-3)=$(NF-1)}1' OFS='"' myFile
it is telling us that line number 2 in your input file (the one...
22,440
Posted By Don Cragun
I have never heard of a linux command on Windows....
I have never heard of a linux command on Windows.

Are the files you want to merge on Windows or are they on a Linux system that you are accessing while you are logged into a Windows system?

Are...
Showing results 1 to 17 of 17

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