Search Results

Search: Posts Made By: bob123
Forum: Programming 03-08-2020
6,634
Posted By wisecracker
If you are using one line it HAS to be: ...
If you are using one line it HAS to be:
MYURL=str(pattern.search(script.text).group(0)); MYURL=str.replace(MYURL, '\u002D', '-'); print(MYURL)
Forum: Programming 03-08-2020
6,634
Posted By wisecracker
Hi bob123... Which version of python 3.x.x are...
Hi bob123...
Which version of python 3.x.x are you using, OS, and machine...

--- Post updated at 11:41 PM ---

I hope this does not attach itself to the previous...
It looks like you are using...
11,244
Posted By nezabudka
Hi What about 'sed'? sed -r...
Hi
What about 'sed'?
sed -r 's%^[^-]*-(.*)-.*/(.*)/.*$%\1 \2\n&%' file
15,259
Posted By vgersh99
how about for starters: echo...
how about for starters:
echo 'https://example.com/live-hls/bla:bob-sd-blabla/playlist.m3u8' | sed 's#.*:\([^-][^-]*\)-.*#\1#'
15,259
Posted By nezabudka
Hi sed 's#.*:\([^-][^-]*\)-.*#\1\n&#'
Hi
sed 's#.*:\([^-][^-]*\)-.*#\1\n&#'
Forum: Programming 10-12-2019
4,049
Posted By wisecracker
Try: print('https://www.meihoski.co.jp/movie/'...
Try:
print('https://www.meihoski.co.jp/movie/' + a['href'])
2,759
Posted By jgt
cgc6:/tmp# echo...
cgc6:/tmp# echo "http://example.com/test/morestuff"|./t 999
test
http://example.com/test999/morestuff

cgc6:/tmp#...
2,759
Posted By RudiC
Would this come close to what you need? echo...
Would this come close to what you need?
echo "http://example.com// > test" | awk -F"/" '{$4 = $NF; sub (" > ",_, $4)}1' OFS="/"
http://example.com/test/ > test
2,759
Posted By RavinderSingh13
Hello bob123, Could you please try following...
Hello bob123,

Could you please try following approaches too and let me know if this helps you.
Solution 1st: Using awk.

awk '{val=$0;sub(/.*com\//,"");sub(/\/.*/,"");print val,$0}' Input_file...
2,759
Posted By RavinderSingh13
Hello bob123, Could you please try following...
Hello bob123,

Could you please try following and let me know if this helps you.

sed 's/\(.[^//]*\)\(\/\/\)\(.[^/]*\)\(\/\)\(.[^\/]*\)\(.*\)/\1\2\3\4\5\6 \5/' Input_file


Thanks,
R....
1,620
Posted By drl
Hi. Using a utility from the package...
Hi.

Using a utility from the package dateutils, dconv:

#!/usr/bin/env bash

# @(#) s1 Demonstrate date manipulation, format changes, dconv.

# Utility functions: print-as-echo,...
1,620
Posted By rdrtx1
try: sed...
try:
sed 's/\([0-9][0-9][0-9][0-9]\)-\([0-9][0-9]\)-\([0-9][0-9]\)/\3-\2-\1/' infile
1,189
Posted By drl
Hi. For the data sets, data[123], as noted...
Hi.

For the data sets, data[123], as noted in #2:
$ paste data*
AAA AAA AAA
BBB BBB BBB
CCC CCC
On a system like:
OS, ker|rel, machine: Linux, 3.16.0-4-amd64,...
1,189
Posted By RavinderSingh13
Hello bob123, Could you please try following...
Hello bob123,

Could you please try following and let me know if this helps you.

awk 'FNR==1{n=n>Q?n:Q;Q=1;}{A[Q]=A[Q]?A[Q] OFS $0:$0;Q++} END{for(i=1;i<=n-1;i++){print A[i]}}' Input_file1 ...
2,058
Posted By Don Cragun
Ouch. Yes. Sorry. I wasn't paying close enough...
Ouch. Yes. Sorry. I wasn't paying close enough attention.

I'm glad you got it to work.
2,058
Posted By Don Cragun
Do you mean something like: awk 'NR%2 ==...
Do you mean something like:
awk 'NR%2 == 1{$0="some text "$0}1' file
1,367
Posted By Scrutinizer
Or: awk '1;getline<f>0' f=file2 file1 >...
Or:
awk '1;getline<f>0' f=file2 file1 > file3
1,367
Posted By RudiC
Orawk 'NR==FNR{a[FNR]=$0;next} {print a[FNR]} 1'...
Orawk 'NR==FNR{a[FNR]=$0;next} {print a[FNR]} 1' file1 file2 > file3
1,367
Posted By Don Cragun
If you go with awk instead of RudiC's suggestion...
If you go with awk instead of RudiC's suggestion of paste you can still simplify your code (as Scrutinizer suggested) and get exactly the same output:
awk 'NR==FNR{a[FNR]=$0;next} {print a[FNR] "\n"...
1,367
Posted By RudiC
This is exactly what paste is for:paste -d"\n"...
This is exactly what paste is for:paste -d"\n" file[12]
AAAA
XXXX
BBBB
YYYY
CCCC
ZZZZ
1,367
Posted By Scrutinizer
Why are you printing a backspace character (\b) ?...
Why are you printing a backspace character (\b) ? Just leave it out.



--
As a matter of efficiency, set OFS="" in the BEGIN section...
In fact, you do not need it at all if your use print...
2,101
Posted By drl
Hi. For the data in post #5, I got this with...
Hi.

For the data in post #5, I got this with RudiC's code:
Follow the Money Episode 1
Follow Your Heart Episode 0
Looks right to me ... cheers, drl
2,101
Posted By RudiC
Trysed 'N; s/<[^>]*>\| \+//g; s/\n/ /g'...
Trysed 'N; s/<[^>]*>\| \+//g; s/\n/ /g' file
2,101
Posted By RudiC
With that sparse info given by you, this will do...
With that sparse info given by you, this will do EXACTLY what you requested for EXACTLY the samples in post#1:sed -n '1h;1!H;${x;s/<[^>]*>\|\n\|^ *//gp}' file
Follow the Money Episode 1
2,101
Posted By drl
Hi. With augmented data: #!/usr/bin/env...
Hi.

With augmented data:
#!/usr/bin/env bash

# @(#) s1 Demonstrate extraction from HTML, lynx.

# Utility functions: print-as-echo, print-line-with-visual-space, debug.
# export...
Showing results 1 to 25 of 25

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