-3

Thank you in advance if you could help me save a huge amount of time.

I have tests that look like this:

These questions refer to the audio file 001_TOEIC_part3.mp3

1). Where is the conversation taking place?

(A) In a church 

(B) In an office

(C) In a classroom

(D) In a park

2). What problem does the woman have?

(A) She will be late for work.

(B) She cannot make the meeting.

(C) She is struggling with her presentation.

(D) She worked late yesterday.

3). What does the man offer?

(A) To help

(B) To write her report

(C) To get coffee

(D) To make copies

These questions refer to the audio file 002_TOEIC_part3.mp3

1). What does the man plan to do?

(A) Have a party

(B) Buy office supplies

(C) Take a vacation

(D) Ask the woman out

2). Why does the man call the woman?

(A) To inquire about prices

(B) To sell her food

(C) To invite her to a party

(D) To order food and drinks

3). Where will the party be held?

(A) In a city park

(B) At the man's company

(C) On the beach

(D) In a theater

And I would like them to look like this:

These questions refer to the audio file 001_TOEIC_part3.mp3

1). Where is the conversation taking place?

(A) In a church (B) In an office (C) In a classroom (D) In a park

2). What problem does the woman have?

(A) She will be late for work. (B)  She cannot make the meeting. (C) She is struggling with her presentation. (D) She worked late yesterday.

3). What does the man offer?

(A) To help (B) To write her report (C) To get coffee (D)   To make copies

These questions refer to the audio file 002_TOEIC_part3.mp3

1). What does the man plan to do?

(A) Have a party (B) Buy office supplies (C) Take a vacation (D) Ask the woman out

2). Why does the man call the woman?

(A) To inquire about prices (B) To sell her food (C) To invite her to a party (D) To order food and drinks

3). Where will the party be held?

(A) In a city park (B) At the man's company (C) On the beach (D) In a theater

So I would like to sort the answer options from (A) to (D) from vertical to horizontal in Notepad++. Each audio file has got three questions, each question has four options to chose from (A), (B), (C), (D) The source file look exactly the same as the one that I inserted here. I really appreciate any help. Regards Aron

Aron
  • 29
  • 4
  • Possible duplicate of [Learning Regular Expressions](https://stackoverflow.com/questions/4736/learning-regular-expressions) – Biffen Apr 28 '18 at 10:44
  • Select a newline followed by an escaped opening bracket and the letters B-Z and replace the newline with a space. Make sure Notepad++ selects the whole document and not line by line. – ssc-hrep3 Apr 28 '18 at 10:46

1 Answers1

1

You could try replacing:

(?i)\s*[\n\r]+(?=\([BCD]\))

With a single space, As demonstrated on regex101.com

Explanation -

The code replaces all occurrences of zero-or-more spaces followed by two newlines or carriage returns, (, B/C/D (case-insensitive, so you can keep them lowercase :) ), and ) with a space.

(?i) tells the regex to be case-insensitive
\s* matches zero-or-more spaces
[\n\r]+ matches one or more newlines (enter keys, basically)
(?=\([BCD]\)) is a positive look-ahead that matches the text which is followed by (B/C/D), but does not match the (B/C/D) part.

Note - If you may have more than 4 options, consider changing (?=\([BCD]\)) to (?=\([B-Z]\)) in the regex.

Community
  • 1
  • 1
Robo Mop
  • 2,958
  • 1
  • 7
  • 23
  • Thank you. Great! It worked perfectly, just like expected. Great Job! – Aron Apr 28 '18 at 19:01
  • @Aron If you feel that an answer has solved your original problem, consider marking it as helpful for future references :) – Robo Mop Apr 29 '18 at 03:31