-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexplore.nu
More file actions
112 lines (92 loc) · 3.74 KB
/
Copy pathexplore.nu
File metadata and controls
112 lines (92 loc) · 3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# LinkedIn Connection Data Explorer
# Complementary Nushell scripts for quick data analysis and exploration
# Quick overview of connections data
def main [] {
print "LinkedIn Connections Explorer - Quick Analysis"
print "============================================="
if not (path exists "Connections.csv") {
print "❌ Connections.csv not found!"
return
}
connections_overview
companies_analysis
positions_analysis
recent_connections
}
# Overview of connections data
def connections_overview [] {
print "\n📊 CONNECTIONS OVERVIEW:"
let data = open Connections.csv | skip 3 # Skip LinkedIn header text
let total = $data | length
let with_email = $data | where "Email Address" != "" | length
let email_rate = ($with_email / $total * 100) | math round --precision 1
print $"Total connections: ($total)"
print $"Connections with email: ($with_email) \(($email_rate)%\)"
print $"Date range: (($data | get "Connected On" | first) | date format "%Y-%m-%d") to (($data | get "Connected On" | last) | date format "%Y-%m-%d")"
}
# Analyze companies
def companies_analysis [] {
print "\n🏢 TOP COMPANIES:"
open Connections.csv
| skip 3
| get Company
| where $it != ""
| group-by $it
| transpose company count
| sort-by count --reverse
| first 10
| each { |row| print $" ($row.count | str rpad -l 3): ($row.company)" }
}
# Analyze positions
def positions_analysis [] {
print "\n💼 POSITION KEYWORDS ANALYSIS:"
let positions = open Connections.csv | skip 3 | get Position | str downcase
# Innovation keywords
let innovation = $positions | where ($it | str contains "innovation") | length
let digital = $positions | where ($it | str contains "digital") | length
let transformation = $positions | where ($it | str contains "transformation") | length
let strategy = $positions | where ($it | str contains "strategy") | length
print $" Innovation: ($innovation)"
print $" Digital: ($digital)"
print $" Transformation: ($transformation)"
print $" Strategy: ($strategy)"
# Seniority levels
let chief = $positions | where ($it | str contains "chief") | length
let director = $positions | where ($it | str contains "director") | length
let manager = $positions | where ($it | str contains "manager") | length
let lead = $positions | where ($it | str contains "lead") | length
print $"\n👔 SENIORITY LEVELS:"
print $" Chief/C-Level: ($chief)"
print $" Director: ($director)"
print $" Manager: ($manager)"
print $" Lead: ($lead)"
}
# Recent connections
def recent_connections [] {
print "\n📅 RECENT CONNECTIONS (Last 10):"
open Connections.csv
| skip 3
| sort-by "Connected On" --reverse
| first 10
| select "First Name" "Last Name" "Company" "Connected On"
| each { |row| print $" ($row."Connected On"): ($row."First Name") ($row."Last Name") @ ($row.Company)" }
}
# Search for specific keywords
def search [keyword: string] {
print $"🔍 Searching for '($keyword)' in positions..."
open Connections.csv
| skip 3
| where Position =~ $"(?i)($keyword)"
| select "First Name" "Last Name" Company Position
| each { |row| print $" ($row."First Name") ($row."Last Name") @ ($row.Company): ($row.Position)" }
}
# Company deep dive
def company [name: string] {
print $"🏢 Deep dive: ($name)"
open Connections.csv
| skip 3
| where Company =~ $"(?i)($name)"
| select "First Name" "Last Name" Position "Connected On"
| sort-by "Connected On" --reverse
| each { |row| print $" ($row."First Name") ($row."Last Name"): ($row.Position) \(($row."Connected On")\)" }
}