Chapter 61 – IMPORTXML is Wrapped Inside CONCATENATE

“IMPORTXML.”

Inoue handled the ghost that I captured with the beam.

I had trouble handling the squiggly beams from the beam pack at first, but after using it for a while, I got used to it. To be honest, it’s much easier than swinging as sasumata around on a daily basis. The processing was going smoothly, but there were still a lot left.

“I think this is the 10th one. I feel like we haven’t even gotten rid of half of them yet.”

“Are you tired? The functions we’ve been dealing with recently have mostly been QUERY’s and FILTER’s, functions which collate multiple cells down to a single one. There aren’t that many of them as a result. But, IMPORTXML produces multiple results from a single cell. That’s why there are so many.”

“Does that mean that in many cases, the results will span across multiple cells?”

“Yeah, this happens a lot when you try to get long elements, such as the body of a webpage. Each line break outputs to a separate cell. Well, in such cases, they are often combined using CONCATENATE.”

CONCATENATE. I think that was something that joined strings from multiple cells.

If you entered,

A1:Google

B1:Spreadsheets

=CONCATENATE(A1,B1)

Would give the result ‘GoogleSpreadsheets’. If the cells were fixed, you could use this as well,

=A1&B1

The same result with a space could also be obtained by writing,

=A1&” “&B1

I hadn’t used CONCATENATE much because of the advantage of applying spaces and joining characters with the other method. However, in the case of IMPORTXML, it wasn’t known how many cells the results might be returned over. For example, if the following was written into cell A1.

=IMPORTXML(“https://kakuyomu.jp/works/1177354054887646455/episodes/1177354054887646515”, “//*[@id=’contentMain-inner’]/div/div/div”)

A1: When I woke up, I was in a room with white tiles.

B1:(Blank)

C1: What was happening? The last thing that I could remember, I had just finished uploading a creative piece at 11pm that had to be delivered the next day. After that, I checked up on a project report that had been passed to me after a colleague had left the company only to find it in a mess. No rules had been set up and there were just references everywhere. Depending on the page, some aggregated values were just hardcoded in. “I can’t let such bad work pass” was what I said. But, because my Excel skills weren’t that good, I ended up having to work overtime.

(Omitted)

AR1: Damn it, I’m dying from confusion. What do you mean we’re in Google Spreadsheets, this isn’t heaven or another world?

Results would be returned over many cells, but it wasn’t possible to know in advance how many cells it would be.

=CONCATENATE(IMPORTXML(“https://kakuyomu.jp/works/1177354054887646455/episodes/1177354054887646515”, “//*[@id=’contentMain-inner’]/div/div/div”))

By wrapping it with CONCATENATE, you could display all the sentences in a combined state in the same cell. By the way, what on earth was I thinking about? What was that sentence I just thought of? I don’t recognise it, but it felt very familiar. In the first place, I’ve never heard of this site called kakuyomu.jp, but why do I remember random numbers for such a detailed URL? What on earth is happening to me?

“Hey! What are you doing? A CONCATENATE has appeared.”

Saito called out to me, bringing me back to my senses. When I looked over to what he was pointing at, I saw that it wasn’t a ghost…but a physical body. More than anything else, it smelled. So there were zombies.

Saito handed me something like a crowbar.

“Inoue and I will process the rest of the IMPORTXML, so I’ll leave the CONCATENATE to you.”

“Eh, it’s my first time seeing one, so I’m a little nervous…”

“It will be fine. They’re slow. Just crush their heads then process them.”

“…Isn’t that gross?”

“Don’t complain, just do it. Show some guts. That’s a job for young people, right? ”

“Why are you suddenly bringing up the culture of a company from the Showa era? This is a global company and it’s already the Heisei era.”

“Woah, woah. I know. Takahashi-san, please do me a favour this time. Please!”

Did he really hate it that much? Pushed on by Saito’s sudden polite expression, I reluctantly agreed. As I held onto the crowbar like object, five CONCATENATE’s staggered towards me while groaning.

 

※Functions and Others

CONCATENATE https://support.google.com/docs/answer/3094123

Something like a crowbar https://ja.wikipedia.org/wiki/%E3%83%90%E3%83%BC%E3%83%AB%E3%81%AE%E3%82%88%E3%81%86%E3%81%AA%E3%82%82%E3%81%AE

[Previous Chapter] [Table of Contents] [Next Chapter]

Leave a Reply

Your email address will not be published. Required fields are marked *