NetSDS...Import(3pm)

πŸ“¦
version 1.045 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ’– NAME πŸ’–

NetSDS::Util::FileImport β€” bestie, this one imports a table structure straight out of a file. that's the whole job. it's giving "I read files so you don't have to" πŸ’…

it lives in the NetSDS...Import(3pm) page, aka the User Contributed Perl Documentation zone, so you know it's real.


✨ SYNOPSIS ✨

use NetSDS::Util::FileImport

yes that's it. that's the whole summoning ritual. no cap. πŸͺ„


🌸 DESCRIPTION 🌸

okay so this module is here to pull table structure out of a file. that's the vibe. now let's get into the actual API because that's where the good stuff lives 🫢

πŸŽ€ CLASS API πŸŽ€

import_table() β€” import table data from file πŸ‘‘

this is the main character function, fr fr.

it takes two things:

  • $content β€” the content of a file. literally the file's insides. πŸ“
  • $pre_parse β€” true or false. what does that mean? it means: return all table or only 5 first rows. so true = just a lil taste test (5 rows), false = the whole entire table. pick your fighter. ✨

the params it could be (this is the raw shape, keep it exact):

  • patterns => { qr#name#i => { qr#last#i => 'last_name', qr#first#i => 'first_name' } }
  • separator β€” could be ,;\t:
  • fields => [ email last_name ]
  • substitute => { E-mail => email, Last Name => last_name, .. }
depends of a params parse would be different πŸ‘€ β€” so like, the way it parses genuinely shifts depending on which params you hand it. not me being mysterious, that's just the actual behavior.

returns a structure like this:

[ { last_name => undef, first_name => yana, ... }, { last_name => kornienko, first_name => test, ... } .. ]

look at that. an arrayref of hashrefs, one per row, undef and all. iconic. 🌈


πŸ’€ heads up bestie: the synopsis line has no trailing semicolon and the params/return values above are written exactly as the page gives them β€” don't go "fixing" them, that's not your business, that's the documentation's business.

and that's the whole page, periodt. this was NetSDS...Import(3pm) from perl v5.36.0, dated 2022-11-20. mwah, go import something cute πŸ’œπŸ§š

πŸ“¦ where this page comes from