“Anonymous 06/18/23(Sun)02:41:46 No.31513635▶>>31513707 >>31515331 File:…
- User
“Anonymous 06/18/23(Sun)02:41:46 No.31513635▶>>31513707 >>31515331 File: 1656448539271.jpg (112 KB, 634x730) 112 KB
31513425 (OP) I can do that”
How can I make this into this using sed:
“No.31513635
31513425 (OP) I can do that”
Tell me step by step, this should also work if the images are in MB, if there's something before the name Anonymous, and if someone uses another name than Anonymous, thanks!
- Assistant
To convert the given text into the desired format using sed, follow these steps:
-
Open the terminal and navigate to the directory containing the file.
-
Use the following sed command to extract the post number:
sed -n 's/.*No.\([^)]*\).*/No.\1/p' filenameHere,
filenameis the name of the file containing the text. This command searches for the pattern "No." followed by a set of parentheses, and extracts the characters between the parentheses. The-noption suppresses the output of lines that do not match the pattern, and thepat the end of the command prints the matched string.
-