Reputation
392
Top tag
Next privilege 500 Rep.
Access review queues
Badges
5 12
Impact
~22k people reached

  • 0 posts edited
  • 0 helpful flags
  • 12 votes cast
Jul
7
awarded  Popular Question
Apr
15
awarded  Notable Question
Mar
18
awarded  Notable Question
Feb
24
accepted move content from a folder with unknown name up one directory
Feb
24
comment move content from a folder with unknown name up one directory
rmdir . produces an error: Invalid argument.
Feb
24
asked move content from a folder with unknown name up one directory
Dec
9
accepted Insert text from file inline after matching pattern in another file
Dec
9
comment Insert text from file inline after matching pattern in another file
brilliant, thanks for the help!
Dec
9
comment Insert text from file inline after matching pattern in another file
Ok, that worked, but the JSON is getting inserted right BEFORE the pattern now: awk '/First/ { while(getline line<"File1.txt"){print line} }1' infile.txt
Dec
9
comment Insert text from file inline after matching pattern in another file
The actual JSON does not need to be altered, I want to insert the JSON after the pattern so that there is not a newline between the pattern and the start of the JSON.
Dec
9
comment Insert text from file inline after matching pattern in another file
@mikeserv Thanks for the help. I'd happy to try your solution, but after reading your solution, I'm not sure how to implement what you suggest. Can you post an example?
Dec
9
comment Insert text from file inline after matching pattern in another file
Added an example JSON data file that does not insert correctly for me.
Dec
9
revised Insert text from file inline after matching pattern in another file
added 417 characters in body
Dec
9
comment Insert text from file inline after matching pattern in another file
In my actual use case, I'm inserting a large JSON file and this awk example doesn't work. I just get a single left brace, [ inserted after the pattern match. Normal text works fine, but not JSON?
Dec
9
revised Insert text from file inline after matching pattern in another file
added 25 characters in body
Dec
9
asked Insert text from file inline after matching pattern in another file
Sep
23
awarded  Notable Question
Sep
16
awarded  Popular Question
Aug
6
awarded  Notable Question
Jul
2
awarded  Curious