Skip to content
← Back to Community
How to search ?
Profile icon
Arrows12

I want to know how to search i need to search in a file pls any one help me

Voters
Profile icon
Netshh
Profile icon
cdworld147
Profile icon
IbraheemShaik
Profile icon
Arrows12
Comments
hotnewtop
Profile icon
JBloves27

Wdym?

Profile icon
Arrows12

@JBYT27 iam trying to get help from people

Profile icon
Arrows12

@JBYT27 help me

Profile icon
JBloves27

Ik, but what kind of helps? @Arrows12

Profile icon
tussiez

@Arrows12 Do you want to find text in the script file?
Use Ctrl or Command(Mac) + F.

Profile icon
tussiez

Do you wish to search for text in a text file?
Then

//Why do I always use readFileSync? Idk lol const fs = require('fs'); //Get file let file = fs.readFileSync('things.txt','utf8'); //By line: file = file.split('\n'); let word = file[file.indexOf('something')]

If you want to search for text in Repl, use Ctrl/Command + F (Find)

Profile icon
RYANTADIPARTHI

Solution

use readdir for searching file in node.js. HEre's a link that teaches you how to do it.

https://nodejs.org/en/knowledge/file-system/how-to-search-files-and-directories-in-nodejs/

IT should work

Profile icon
19wintersp

Ctrl+F (Cmd+F on a Mac) will let you search in the IDE.